#include "widget.h"
#include "ui_widget.h"
#include <QDebug>
#include <QResizeEvent>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    QRect rect = this->geometry();
    ui->label->setGeometry(rect.x(),rect.y(),rect.width(),rect.height());
    QPixmap pixmap(":/background.jpg");

    ui->label->setPixmap(pixmap);
    ui->label->setScaledContents(true);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::resizeEvent(QResizeEvent *event)
{
    qDebug()<<event->size();
    ui->label->setGeometry(0,0,event->size().width(),event->size().height());
}

